/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Army.task;

import Army.BuildingAndUnit;
import java.awt.Point;

/**
 *
 * @author Huy
 */
public class Task {

	protected String taskName;
	protected BuildingAndUnit source;
	protected BuildingAndUnit target;
	protected boolean isDone = false;

	public boolean isIsDone() {
		return isDone;
	}

	public String getName() {
		return taskName;
	}

	public Task() {
	}

	public Task(BuildingAndUnit source,BuildingAndUnit target) {
		this.source = source;
		this.target = target;
	}

	public Point getPosisition()
	{
		return target.getPosition();
	}
	
	public boolean isInView(Point p)
	{
		return getPosisition().distance(p)<source.getViewRange()+2*source.getAttackRange();
	}
	public boolean execute() {
		return true;
	}
}
